package org.xiaoyu.txy.weixin.mp.service;

import org.xiaoyu.txy.weixin.BaseService;
import org.xiaoyu.txy.weixin.contant.WXContant;
import org.xiaoyu.txy.weixin.mp.model.ReqMessageTemplate;
import org.xiaoyu.txy.weixin.mp.model.ReqToken;
import org.xiaoyu.txy.weixin.mp.model.ResMessageTemplate;
import org.xiaoyu.txy.weixin.mp.model.ResToken;

public class WXMpService extends BaseService{
	
	/**
	 * 获取公众号token
	 * @param reqToken
	 * @return
	 */
	public ResToken getToken(ReqToken reqToken) {
		return reqInterface(WXContant.GET_TOKEN_URL, reqToken, ResToken.class);
	}
	
	/**
	 * 发送模板消息
	 * @param messageTemplate 模板信息
	 * @param accessToken token
	 * @return
	 */
	public ResMessageTemplate sendMessageTemplate(ReqMessageTemplate messageTemplate, String accessToken) {
		return reqInterfaceAndAccessToken(WXContant.MESSAGE_TEMPLATE_SEND, accessToken, messageTemplate, ResMessageTemplate.class);
	}
	
	
	

}
